// api
const request = require('../utils/request')

//  客户 列表
export function clientList(data) {
    return request({
        method: "get",
        url: "/custom.custinfo/cvCusInfo/list",
        header: {
            "Content-Type": "application/x-www-form-urlencoded",
            'reqType': 'wx',
            'X-Access-Token': wx.getStorageSync('token')
        },
        data
    });
}

//  客户 修改
export function clientEdit(data) {
    return request({
        method: "post",
        url: "/custom.custinfo/cvCusInfo/editWx",
        header: {
            "Content-Type": "application/json",
            'reqType': 'wx',
            'X-Access-Token': wx.getStorageSync('token')
        },
        data
    });
}

//  客户 新增
export function clientAdd(data) {
    return request({
        method: "post",
        url: "/custom.custinfo/cvCusInfo/add",
        header: {
            "Content-Type": "application/json",
            'reqType': 'wx',
            'X-Access-Token': wx.getStorageSync('token')
        },
        data
    });
}
//  主体 列表
export function bodyList(data) {
    return request({
        method: "get",
        url: "/cus.info/infoWx/queryPaperByCustId",
        header: {
            "Content-Type": "application/x-www-form-urlencoded",
            'reqType': 'wx',
            'X-Access-Token': wx.getStorageSync('token')
        },
        data
    });
}
//  主体 添加
export function bodyAdd(data) {
    return request({
        method: "post",
        url: "/cus.info/infoWx/addCusAndPayer",
        header: {
            "Content-Type": "application/json",
            'reqType': 'wx',
            'X-Access-Token': wx.getStorageSync('token')
        },
        data
    });
}

//  商谈记录
export function talksRecord(data) {
    return request({
        method: "get",
        url: "/custom.custinfo/cvCusInfo/listTrack",
        header: {
            "Content-Type": "application/x-www-form-urlencoded",
            'reqType': 'wx',
            'X-Access-Token': wx.getStorageSync('token')
        },
        data
    });
}

// 商谈 新增
export function talkAdd(data) {
    return request({
        method: "post",
        url: "/custom.custinfo/cvCusInfo/addTrack",
        header: {
            "Content-Type": "application/json",
            'reqType': 'wx',
            'X-Access-Token': wx.getStorageSync('token')
        },
        data
    });
}

//  购买记录
export function buyRecord(data) {
    return request({
        method: "get",
        url: "/custom.custinfo/cvCusInfo/listBuy",
        header: {
            "Content-Type": "application/x-www-form-urlencoded",
            'reqType': 'wx',
            'X-Access-Token': wx.getStorageSync('token')
        },
        data
    });
}

//  客户对账 列表
export function checkList(data) {
    return request({
        method: "get",
        url: "/cus.info/infoWx/queryPayerWx",
        header: {
            "Content-Type": "application/x-www-form-urlencoded",
            'reqType': 'wx',
            'X-Access-Token': wx.getStorageSync('token')
        },
        data
    });
}

//  客户对账 详情
export function checkInfo(data) {
    return request({
        method: "get",
        url: "/cus.info/infoWx/queryPaymentByPayerIdWx",
        header: {
            "Content-Type": "application/x-www-form-urlencoded",
            'reqType': 'wx',
            'X-Access-Token': wx.getStorageSync('token')
        },
        data
    });
}

//  客户统计 列表
export function clientStat(data) {
    return request({
        method: "get",
        url: "/cus.info/infoWx/cusStatWx",
        header: {
            "Content-Type": "application/x-www-form-urlencoded",
            'reqType': 'wx',
            'X-Access-Token': wx.getStorageSync('token')
        },
        data
    });
}

//  销售统计 列表
export function sellStat(data) {
    return request({
        method: "get",
        url: "/cus.info/infoWx/salStatWx",
        header: {
            "Content-Type": "application/x-www-form-urlencoded",
            'reqType': 'wx',
            'X-Access-Token': wx.getStorageSync('token')
        },
        data
    });
}